<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('gid') -> comment('商品ID');
            $table->string('goodsname') -> comment('商品名称');
            $table->integer('tid') -> comment('商品类ID');
            $table->string('goodspic') -> comment('商品图片');
            $table->string('goodspic_max') -> comment('商品详情大图');
            $table->double('price', 8, 2) -> comment('商品价格');
            $table->text('desc') -> comment('商品简介');
            $table->string('store') -> comment('商品库存');
            $table->string('scnt') -> comment('销售数量');
            // $table->string('addtime') -> comment('添加时间');
            $table->smallInteger('status') -> comment('状态,0新品,1为在售,2为下架');
            $table->timestamps();
            });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('goods');
    }
}
